<template>
  <div id="app">
    <!-- <img src="./assets/logo.png"> -->
    <div>
      <p>
        If Element is successfully added to this project, you'll see an
        <code v-text="'<el-button>'"></code>
        below
      </p>
      <el-button>el-button</el-button>
    </div>
    <HelloWorld msg="Welcome to Your Vue.js App"/>
	<section>
		<h2>axios http test</h2>
		<div>加载的数据:
			<p>{{info}}</p>
		</div>
	</section>
	<section>
		<h2>mock test</h2>
		<div>加载的数据:
			<p>{{mockinfo}}</p>
		</div>
	</section>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'app',
  components: {
    HelloWorld
  },
  data: function(){
	  return {
		info: null ,
		mockinfo: ''
	  }
  },
  mounted: function(){
	  this.$axios
		.get('https://api.coindesk.com/v1/bpi/currentprice.json')
		.then(response => (this.info = response.data.bpi));
	  this.$axios
		.post('/mock/users')
		.then(response => (this.mockinfo = response.data));
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
